import request  from "@/utils/request";
// 用户信息类型
export interface LoginParamType{
    username:string,
    password:string
}

// 登陆后返回值类型
export interface LoginResultType{
    token:string
}

// 用户信息类型
export interface LoginUserInfoType{
    routes:string[],
    buttons:string[],
    roles:string[],
    name:string,
    avatar:string
}

// 登陆请求
export const reqLogin = (userInfo:LoginParamType)=>{
    return request.post<null,LoginResultType>(`/admin/acl/index/login`,userInfo)
}

// 退出登陆请求
export const reqLogout =()=>{
    return request.post<null,null>(`/admin/acl/index/logout`)
}

// 获取用户信息
export const reqUserInfo = () =>{
    return request.get<null,LoginUserInfoType>(`/admin/acl/index/info`)
}